home *** CD-ROM | disk | FTP | other *** search
- ; Sokoban Final
- ; By Reda Borchardt
-
- ; Variables
- Global ScreenHeight
- Global ScreenWidth
- Global Sokoban
- Global FontImg
- Global DnaBannerImg
- Global DnaBanner2Img
- Global DnaBanner3Img
- Global BottomImg
- Global This_Level_Number = 1
- Global Current_Move
- Global Level_Pivot
- Global CurrentZoom#=1
- Global Camera
- Global CameraPivot
- Global CameraPivot2
- Global NewLevel
- Dim LEVEL_TEMPLATE$(500,21,21)
- Dim CURRENT_LEVEL$(3000,21,21)
-
- ; Initialization
- Include "start.bb"
- Include "keyconstants.bb"
- SetBuffer BackBuffer()
- SetFont LoadFont("Arial",14,1,0,1)
- FontImg = LoadAnimImage("font.bmp",18,16,0,49)
- DnaBannerImg = LoadImage("top-banner.jpg")
- DnaBanner2Img = LoadImage("bottom-banner.jpg")
- DnaBanner3Img = LoadImage("side-banner.jpg")
- LoadLevelData("Levels.dat")
-
- ; Display First Level
- For y = 1 To 21
- For z = 1 To 21
- CURRENT_LEVEL$(CURRENT_MOVE,y,z) = LEVEL_TEMPLATE$(This_Level_Number,y,z)
- Next
- Next
- DisplayLevel3D(CURRENT_MOVE)
-
- ;This is in case the Window mode is enabled.
- If ScreenHeight = 0
- ScreenHeight = 480
- ScreenWidth = 640
- End If
-
- ; Setup Scene
- CameraPivot2 = CreatePivot()
- CameraPivot = CreatePivot(CameraPivot2)
- Camera = CreateCamera(CameraPivot)
- CameraViewport Camera,4,60,ScreenWidth-148,ScreenHeight-128
- PositionEntity Camera,0,32,0
- TurnEntity camera,90,0,0
- AmbientLight(255,255,255)
-
- sphere = CreateSphere(5)
- nebula = LoadTexture("nebula.jpg")
- ScaleEntity sphere,50,50,50
- FlipMesh sphere
- TurnEntity Sphere,180,0,90
- RotateTexture nebula,180
- EntityTexture sphere,nebula
- TextureCoords nebula,0
-
-
- ; Main Loop
- While Not KeyHit(1)
- KeyBoardEvents()
-
- UpdateWorld
- RenderWorld
-
- ; This is the 2D Stuff after the 3D scene has been updated
- BuildTheGui()
-
- Flip
-
- Wend
- End
-
- ;Functions
- Function BuildTheGui()
- ;Draw The Top Banner
- DrawBlock DnaBannerImg,0,0
-
- ;Draw The Bottom Banner
- DrawBlock DnaBanner2Img,0,ScreenHeight-60
-
- ;Draw The Side Banner
- DrawBlock DnaBanner3Img,ScreenWidth-140,60
-
- ;Draw Level Number
- DrawString(30,445,"LEVEL: " + This_Level_number)
- DrawString(480,445,"MOVES: " + Current_Move)
-
- ;Check Whether Level Is Completed
- If LevelStatsBoxes(ThisLevelNumber) = LevelStatsBoxesOnGoals(ThisLevelNumber)
- DrawString(30,240,"CONGRATULATIONS!")
- End If
-
- End Function
-
- Function DrawString(MsgX,MsgY,Message$)
- MsgCount = Len(Message$)
-
- For F = 0 To (MsgCount - 1)
- FontChar = Asc(Lower$(Mid$(Message$,F + 1,1)))
-
- Select FontChar
- ; Letters
- Case 97 : ImgChar = 0 : Case 98 : ImgChar = 1 : Case 99 : ImgChar = 2
- Case 100 : ImgChar = 3 : Case 101 : ImgChar = 4 : Case 102 : ImgChar = 5
- Case 103 : ImgChar = 6 : Case 104 : ImgChar = 7 : Case 105 : ImgChar = 8
- Case 106 : ImgChar = 9 : Case 107 : ImgChar = 10 : Case 108 : ImgChar = 11
- Case 109 : ImgChar = 12 : Case 110 : ImgChar = 13 : Case 111 : ImgChar = 14
- Case 112 : ImgChar = 15 : Case 113 : ImgChar = 16 : Case 114 : ImgChar = 17
- Case 115 : ImgChar = 18 : Case 116 : ImgChar = 19 : Case 117 : ImgChar = 20
- Case 118 : ImgChar = 21 : Case 119 : ImgChar = 22 : Case 120 : ImgChar = 23
- Case 121 : ImgChar = 24 : Case 122 : ImgChar = 25
-
- ; Numbers
- Case 48 : ImgChar = 26 : Case 49 : ImgChar = 27 : Case 50 : ImgChar = 28
- Case 51 : ImgChar = 29 : Case 52 : ImgChar = 30 : Case 53 : ImgChar = 31
- Case 54 : ImgChar = 32 : Case 55 : ImgChar = 33 : Case 56 : ImgChar = 34
- Case 57 : ImgChar = 35
-
- ; Special characters
- Case 63 : ImgChar = 36 : Case 46 : ImgChar = 37 : Case 44 : ImgChar = 38
- Case 39 : ImgChar = 39 : Case 34 : ImgChar = 40 : Case 33 : ImgChar = 41
- Case 40 : ImgChar = 42 : Case 41 : ImgChar = 43 : Case 45 : ImgChar = 44
- Case 58 : ImgChar = 45 : Case 59 : ImgChar = 46 : Case 32 : ImgChar = 48
- End Select
-
- DrawImage FontImg,(F * 15) + MsgX,MsgY,ImgChar
- Next
- End Function
-
- Function LoadLevelData$(filename$)
- filein = ReadFile(filename$)
- starttheloop = False
-
- While Not Eof(filein)
- If Left$(rawline$,1)<> ">" Then rawline$ = ReadLine$(filein)
- If Left$(rawline$,1)= ">"
- starttheloop = True ;Detects the start of a level
- currentlevel = currentlevel + 1 ;Counts the level
- currentrow = 0
- End If
-
- If starttheloop = True And Left$(rawline$,1)=">"
- rawline$ = ReadLine$(filein)
- While Left$(rawline$,1) <> ">"
- currentrow = currentrow + 1
- For i=1 To Len(rawline$)
- LEVEL_TEMPLATE$(currentlevel,currentrow,i)= Mid$(rawline$,i,1)
- Next
- rawline$ = ReadLine$(filein)
- Wend
- End If
- Wend
- CloseFile(filein)
- End Function
-
- Function KeyboardEvents()
- rebuild_level = False
- update_screen = False
-
- If KeyHit(key_numpad_add) Then This_Level_Number = This_Level_Number + 1 : rebuild_level = True : CURRENT_MOVE = 0
- If KeyHit(key_numpad_sub) Then This_Level_Number = This_Level_Number - 1 : rebuild_level = True : CURRENT_MOVE = 0
-
- If this_level_number<1 Then this_level_number = 1
- If this_level_number>375 Then this_level_number = 375
-
- If rebuild_level = True
- For y = 1 To 21
- For z = 1 To 21
- CURRENT_LEVEL$(CURRENT_MOVE,y,z) = LEVEL_TEMPLATE$(This_Level_Number,y,z)
- Next
- Next
- DisplayLevel3d(CURRENT_MOVE)
- End If
-
- If KeyDown(key_a)
- CurrentZoom# = CurrentZoom# + 0.01
- CameraZoom Camera,CurrentZoom#
- End If
-
- If KeyDown(key_z)
- CurrentZoom# = CurrentZoom# - 0.01
- CameraZoom Camera,CurrentZoom#
- End If
- If KeyDown(key_arrowpad_left) And KeyDown(key_leftshift) = True Then TurnEntity CameraPivot2,0,-0.3,0
- If KeyDown(key_arrowpad_right) And KeyDown(key_leftshift) = True Then TurnEntity CameraPivot2,0,0.3,0
- If KeyDown(key_arrowpad_up) And KeyDown(key_leftshift) = True Then TurnEntity CameraPivot,-0.3,0,0
- If KeyDown(key_arrowpad_down) And KeyDown(key_leftshift) = True Then TurnEntity CameraPivot,0.3,0,0
-
- If KeyHit(key_arrowpad_left) And KeyDown(key_leftshift) = False Then MovePlayer("l") : update_screen = True
- If KeyHit(key_arrowpad_right) And KeyDown(key_leftshift) = False Then MovePlayer("r") : update_screen = True
- If KeyHit(key_arrowpad_up) And KeyDown(key_leftshift) = False Then MovePlayer("u") : update_screen = True
- If KeyHit(key_arrowpad_down) And KeyDown(key_leftshift) = False Then MovePlayer("d") : update_screen = True
- If KeyHit(key_backspace) And CURRENT_MOVE <> 0 Then CURRENT_MOVE = CURRENT_MOVE - 1 : update_screen = True
- If update_screen Then DisplayLevel3D(CURRENT_MOVE)
- End Function
-
- Function DisplayLevel3D(Move)
- wall_tex = LoadTexture("metal-plate.jpg")
- ground_tex = LoadTexture("ground.jpg")
- box_tex = LoadTexture("metal-plate3.jpg")
- box_tex2 = LoadTexture("metal-plate2.jpg")
-
- If level_pivot Then FreeEntity level_pivot
- level_pivot = CreatePivot()
-
- For y = 1 To 21
- For x = 1 To 21
- If CURRENT_LEVEL$(Move, x, y) = "#"
- cube = CreateCube(level_pivot)
- MoveEntity cube, x*2-21, 0, y*2-21
- EntityTexture cube, wall_tex
- ElseIf CURRENT_LEVEL$(Move,x,y) = "$" Or CURRENT_LEVEL$(Move,x,y) = "*"
- cube = CreateCube(level_pivot)
- MoveEntity cube, x*2-21, 0, y*2-21
- EntityTexture cube, box_tex2
- ElseIf CURRENT_LEVEL$(Move,x,y) = "@" Or CURRENT_LEVEL$(Move,x,y) = "+"
- sphere = CreateSphere(16,level_pivot)
- MoveEntity sphere, x*2-21,0,y*2-21
- EntityColor sphere,255,255,255
- ElseIf CURRENT_LEVEL$(Move,x,y) = "."
- cube = CreateCube(level_pivot)
- MoveEntity cube, x*2-21, -2, y*2-21
- EntityTexture cube, box_tex
-
-
- EndIf
- Next
- Next
- End Function
-
-
- Function MovePlayer(direction$)
- For y = 1 To 21
- For x = 1 To 21
- If CURRENT_LEVEL$(CURRENT_MOVE,y,x) = "@" Or CURRENT_LEVEL$(CURRENT_MOVE,y,x) = "+"
- playerx = y
- playery = x
- End If
- Next
- Next
-
- For y = 1 To 21
- For x = 1 To 21
- CURRENT_LEVEL$(CURRENT_MOVE+1,y,x) = CURRENT_LEVEL$(CURRENT_MOVE,y,x)
- Next
- Next
-
- MoveBoxes(direction$,playerx,playery)
-
- If direction$ = "l" Then ; Move to the left
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- End If
-
- If direction$ = "r" Then ; Move to the right
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- End If
-
- If direction$ = "d" Then ; Move downwards
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- End If
-
- If direction$ = "u" Then ; Move upwards
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "@"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "@" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery) = "+"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "+" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery) = "." ; REMOVE
- End If
- End If
- CURRENT_MOVE = CURRENT_MOVE + 1
-
-
- End Function
-
- Function MoveBoxes(direction$,playerx,playery)
- If direction$ = "l" Then ; Move to the left
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx-2,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx-1,playery) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-2,playery) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx-2,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx-1,playery) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-2,playery) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx-2,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx-1,playery) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-2,playery) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx-2,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx-1,playery) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-2,playery) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx-1,playery) = "." ; REMOVE
- End If
- End If
-
- If direction$ = "r" Then ; Move to the right
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx+2,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx+1,playery) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+2,playery) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx+2,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx+1,playery) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+2,playery) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx+2,playery) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx+1,playery) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+2,playery) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx+2,playery) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx+1,playery) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+2,playery) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx+1,playery) = "." ; REMOVE
- End If
- End If
-
- If direction$ = "u" Then ; Move downwards
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+2) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+1) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+2) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+2) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+1) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+2) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+2) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+1) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+2) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+2) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery+1) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+2) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery+1) = "." ; REMOVE
- End If
- End If
-
- If direction$ = "d" Then ; Move downwards
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-2) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-1) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-2) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-2) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-1) = "$"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-2) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = " " ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-2) = " " And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-1) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-2) = "$" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "." ; REMOVE
- End If
-
- If CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-2) = "." And CURRENT_LEVEL$(CURRENT_MOVE,playerx,playery-1) = "*"
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-2) = "*" ; PUT
- CURRENT_LEVEL$(CURRENT_MOVE+1,playerx,playery-1) = "." ; REMOVE
- End If
- End If
- End Function
-
- Function LevelStatsBoxes(LevelNumber)
- For z = 1 To 21
- For y = 1 To 21
- If CURRENT_LEVEL$(CURRENT_MOVE,y,z)="$" Or CURRENT_LEVEL$(CURRENT_MOVE,y,z)="*" Then boxes = boxes + 1
- Next
- Next
- Return boxes
- End Function
-
- Function LevelStatsBoxesOnGoals(LevelNumber)
- For z = 1 To 21
- For y = 1 To 21
- If CURRENT_LEVEL$(CURRENT_MOVE,y,z)="*" Then boxesongoals = boxesongoals + 1
- Next
- Next
- Return boxesongoals
- End Function
- Function LevelStatsHeight(LevelNumber)
- End Function